#ifndef MARCHINGCUBES_H_
#define MARCHINGCUBES_H_

#include "MCVector.h"
#include "MCTable.h"

typedef struct
{
	MCVector v[3];
	MCVector normal;
} TRIANGLE;

typedef struct
{
	MCVector v[8];
} CELL;

MCVector LinearInterpolation(MCVector v1, MCVector v2, float alpha);



TRIANGLE* MarchingCubesAlgorithm(int X, int Y, int Z, 
				MCVector* vertices, float isoValue, int &numberOfTriangles, HWND hwndParent, HINSTANCE g_hinst);
TRIANGLE* MarchingTetrahedronAlgorithm(int X, int Y, int Z, 
				MCVector* vertices, float isoValue, int &numberOfTriangles, HWND hwndParent, HINSTANCE g_hinst);
TRIANGLE* MarchingFacesAlgorithm(int X, int Y, int Z, 
	MCVector* vertices, float isoValue, int &numberOfTriangles, HWND hwndParent, HINSTANCE g_hinst);
void MarchingTetrahedron(TRIANGLE* triangles,
	MCVector v1, MCVector v2,
	MCVector v3, MCVector v4,
	int &numberOfTriangles, float isoValue);
void MarchingFace(TRIANGLE* triangles,
	MCVector v1, MCVector v2,
	MCVector v3, MCVector v4,
	int &numberOfTriangles, float isoValue);

#endif